/**
 * 审核相关API
 * 
 */
import {
  http
} from '@/common/service.js'

/**
 * 查询用户列表
 * @param {Object} params - 查询参数  
 */
const getUserList = (params) => {
  return http.get('/api/user/list', {
    params
  })
}

// 通用请求方法middleware 演示。文档：https://www.quanzhan.co/luch-request/guide/3.x/#middleware
/**
 * 查询商品信息
 * @param {Object} data - 查询数据
 */
const login = (data) => {
  return http.post('/sys/mLogin',data)
}

/**
 * 获取已办列表数据
 */
const getDoneList = (header) => {
	return http.get('/actTask/doneList', {
		header,
	})
}

/**
 * 获取待办列表的数据
 */
const getTodoList = (header) => {
	return http.get('/actTask/todoList', {
		header,
	})
}

/**
 * 获取具体待办的表单信息
 */
const getAuditDetail = (header, params) => {
	return http.get('/actBusiness/getForm', {
		header,
		params
	})
}

/**
 * 提交通过表单的网络请求 
 */
const passDetail = (header, data) => {
	return http.post(`/actTask/pass?assignees=${data.assignees}&comment=${data.comment}&id=${data.id}&priority=${data.priority}&procInstId=${data.procInstId}&sendEmail=${data.sendEmail}&sendMessage=${data.sendMessage}&sendSms=${data.sendSms}`,'',
		{
			header
		}
	)
}

export default {
	getDoneList,
	getTodoList,
	getUserList,
	getAuditDetail,
	passDetail,
	login,
}